#!/usr/bin/env osascript

on move_to_next_space()
--move to next desktop
tell application "System Events"
	tell application "System Events" to key code 124 using control down
	activate
	delay 2
end tell
end move_to_next_space

on open_terminal(x, y, r, c)
	using terms from application "Terminal"
			tell application "Terminal"
				do script "pwd"
				activate
                tell application "System Events" to keystroke "t" using {command down}
                --delay 0.2
				activate
                set nameofwind to first window

                set bounds of nameofwind  to {x, y,r,c}
			end tell
	end using terms from
end open_terminal

(*
tell application "Google Chrome"
    activate 
    open location "https://www.google.com"
end tell

move_to_next_space()
*)

---------------------------------------------------------
--open terminal
--set xx to 870
--set yy to 458

--open_terminal(xx, 0, 24, 80)
--open_terminal(xx, yy, 24, 80)
--open_terminal(0, 0, 70, 198)

--move_to_next_space()

--open_terminal(0, 0, 24, 80)
--open_terminal(870, 0, 24, 80)
--open_terminal(0, 458, 24, 80)
--open_terminal(870, 458, 24, 80)

set xx to 870
set xx_l to 1440
set yy to 457
set ww to 570
--set hh to 365
set hh to 390

open_terminal(0, 0, ww, hh)
open_terminal(0, yy, ww, yy+hh)
open_terminal(xx, 0, xx+570, hh)
--open_terminal(xx, yy, xx+570, yy+hh)

